/*
    函数防抖
*/
export function debounce(fn, del){
    // 记录上一次的延时器
    var timer = null;
    var del = del || 200;
    return function() {
        var args = arguments;
        var that = this;
        // 清楚上一次计时器
        clearTimeout(timer);
        timer = setTimeout(function(){
            fn.apply(that,args)
        },del)
    }
}